#@layout()

#define script()
<script>

    function doDel(id) {
        ajaxGet("/admin/interact/jpress_addon_interact_comment/doDel/" + id);
    }

    $("#batchDel").click(function () {
        var ids = getSelectedIds();
        if (ids == "") {
            alert('您未选择任何条目');
            return
        }
        ajaxGet("/admin/interact/jpress_addon_interact_comment/doDelByIds?ids=" + ids);
    })

</script>
#end

#define content()
<div class="content-wrapper">

    <section class="content-header">
        <h1>
            管理
            <small>Items</small>
        </h1>
    </section>

    <section class="content">

        <div class="row">
            <div class="col-xs-12">
                #admininteractList()
                <div class="box box-primary">
                    <div class="box-header with-border">

                        <div class="row actionPanel">
                            <div class="col-xs-12">
                                <!--<a href="jpress_addon_interact_comment/edit" class="btn btn-primary ">
                                    <i class="fa fa-fw fa-plus"></i> 新建
                                </a>-->
                                <button type="submit" id="batchDel" class="btn btn-default checkAction"> 批量删除</button>
                            </div>
                        </div>

                    </div>

                    <!-- /.box-header -->
                    <div class="box-body ">


                        #for(e : admininteractList.list)
                        <div>
                            <div class="jumbotron" style="background-color: #f8f9fa;">
                                <div class="container">
                                    <dt>
                                        <span>#(e.user.NICKNAME ??)</span>
                                        <span>咨询：</span>
                                        <span class="date">
                                            #date(e.create_time, "yyyy-MM-dd")
                                        </span>
                                        <p class="h5">
                                            标题:
                                            #(e.title ??)
                                        </p>
                                        <p>
                                            内容:
                                            #(e.content ??)
                                        </p>
                                    </dt>
                                    <hr>
                                <span>
                                #interactCommentList(interact_id=e.id)
                                #for(centity:interactCommentList.list)

                                </span>
                                        <span>#(centity.user.NICKNAME ??) 回复:</span>
                                        <span class="date">#date(centity.create_time, "yyyy-MM-dd HH:ss")</span>
                                        <p>#(centity.content)</p>
                                        <p style="color: blue">
                                            附件:
                                            #if(centity.attachment)
                                            <a href="#(centity.attachment ??)" id="#(centity.id)" target="_blank">下载附件</a>
                                            #else
                                            暂无附件
                                            #end
                                        </p>
                                        <p>联系方式: #(centity.phone_number)</p>
                                        <p>邮箱: #(centity.email)</p>
                                    <hr>
                                #end
                                #end

                                </div>
                            </div>
                        </div>
                        #end


                        #--<table class="table table-striped">
                            <tbody>
                            <tr>
                                <th style="width: 10px">
	                                    <input name="dataItem" onchange="checkAll(this)" type="checkbox"/>
	                                </th>
	                                <th>id</th>
                                    <th>提问人</th>
	                                <th>问题</th>
                                    <th>解答人</th>
                                    <th>附件</th>
	                                <th>创建时间</th>

                            </tr>
                            #for(entry : page.list)
                            <tr class="jp-actiontr">
                                <td><input class="dataItem" type="checkbox" value="#(entry.id)" />
                                </td>
                                <td>
                                    <strong>
                                        <a href="#(CPATH)/admin/interact/jpress_addon_interact_comment/edit/#(entry.id)"> #(entry.id ??) </a>
                                    </strong>
                                    <div class="jp-actionblock">
                                        <div class="jp-actionitem">
                                            <a href="/admin/interact/jpress_addon_interact_comment/edit/#(entry.id)">编辑</a> |
                                            <a href="javascript:;" class="red-action"
                                               onclick="doDel('#(entry.id)')">删除</a>
                                        </div>
                                    </div>
                                </td>

                                <td>#(entry.jpressAddonInteract.user.nickname ??)</td>
                                <td>#(entry.jpressAddonInteract.title ??)</td>
                                <td>#(entry.user.nickname ??)</td>
                                <td>
                                    #if(entry.attachment ??)
                                    <a href="#(entry.attachment ??)">下载附件</a>
                                    #else
                                    无附件
                                    #end
                                </td>
                                <td>#(entry.create_time)</td>
                            </tr>
                            #end
                            </tbody>
                        </table>--#
                    </div>
                    <!-- /.box-body -->
                    <div class="box-footer">
                        <div class="row">
                            <div class="col-sm-12">
                                <ul class="pagination pull-right">
                                    #admininteractListPaginate()
                                    #for(page : pages)
                                    <li class="paginate_button #(page.style ??)">
                                        <a href="#(page.url??)">#(page.text??)</a>
                                    </li>
                                    #end
                                    #end
                                </ul>
                            </div>
                        </div>
                    </div>
                </div>
                #end
                <!-- /.box -->
            </div>
        </div>

    </section>
</div>
#end
